//
//  MVCVO.m
//  Demo_MVC
//
//  Created by 陈冰 on 2020/3/8.
//  Copyright © 2020 ChenBing. All rights reserved.
//

#import "MVVMModel.h"

@implementation MVVMModel

// model ==> NSDictionary
+ (instancetype)modelWithDict:(NSDictionary *)aDict{
    MVVMModel *model = [[[self class] alloc] initWithDict:aDict];
    return model;
}
 
- (instancetype)initWithDict:(NSDictionary *)aDict{
    self = [super init];
    if (self) {
        //setValuesForKeysWithDictionary 可通过dict快速赋值
        [self setValuesForKeysWithDictionary:aDict];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    //不需要实现，此方法是防止model中没有对应key导致的崩溃
}

@end
